1. Field of the Invention
The present invention relates to an image processing method, and particularly to an image processing method for detecting differences between image macro-blocks at the same position of adjacent images and further judging whether to compress the macro-blocks in a skip mode, by calculating and comparing the pixel differences when inputting images, and a method for detecting differences between different image macro-blocks.
2. Description of Related Art
For the purpose of accelerating the encoding/decoding operation or saving data storage space, in dynamic image compressing technology, not all the images can be entirely encoded. FIG. 1 is a schematic diagram of an image encoding sequence and the coding type of dynamic images; FIG. 2 is a schematic flowchart of a conventional macro-block encoding procedure. Please refer to FIGS. 1 and 2 as an example, wherein the horizontal axis represents the inputting sequence of dynamic images (image displaying sequence). Having no other images for reference, the first image I0 is encoded as an intra pictures (I-pictures) and the next input images B0 and B1 are stored in a memory instead of being processed immediately. After an image P0 is input, it is encoded as predicted pictures (P-pictures), thereafter B0 and B1 are encoded.
During the P-picture encoding process, the steps S205 and S210 are for checking the similarity of the macro-blocks at the same positions of images I0 and P0 for improving the compressing efficiency. If the macro-blocks at the same positions of the two images are similar, the macro-block of image P0 is judged in a skip mode. In other words, when a certain macro-block is judged as a skip mode, the macro-block of the image P0 will skip the encoding step to improve the compressing efficiency (step 215). Therefore, the pixel value of the macro-block will be equal to that of the macro-block at the same position of the image I0 when decoding. Otherwise, the macro-block will be encoded (step 220), if it is not of a skip mode.
When a certain macro-block of the image P0 is determined to be of a skip mode during the above-described P-picture encoding process, in order to improve the compressing efficiency, steps S225 to S230 are performed upon the encoding of all of the following bidirectional pictures (B-pictures) B0 and B1 such that the macro-block of image B0 or B1 which is at the same position with that of image P0 are in a skip mode. In other words, a macro-block of a B-picture will not be encoded (step 235) if the macro-block at the same position of its previous P-picture is of a skip mode; otherwise, a macro-block of the B-picture will be encoded (step 220), if the macro-block at the same position of its previous P-picture is not of a skip mode. When a macro-block of a B-picture is skip mode, the value of which when decoding will be equal to the value of the macro-block at the same position of the previous decoded P-picture. The encoding sequence is performed as below: I0 is the first encoded image, and the succeeding image P1 is encoded. After P-picture P1 is coded, the images B0 and B1 are encoded, then P2 is encoded, following, B-picture of images B2 and B3 are encoded in sequence.
However, although a certain macro-block of image P0 is similar to the macro-block at the same position of image I0, it is not assured that the macro-blocks at the same position of all images (B0 and B1) between images I0 and P0 are similar to the certain macro-block of image P0. Under this circumstance, if the differences between macro-blocks at the same position of images B-picture and P-picture are obvious, the differences between an original image and its corresponding image after compressed by the foregoing conventional technology and then decoded would also be huge; that is, the image would have poor encoding quality.